package com.authentication;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.util.Collection;

public class RBACUser implements UserDetails {

    private String userName;

    private Long userId;

    private Long deptId;

    public Long getUserId() {
        return userId;
    }

    public Long getDeptId() {
        return deptId;
    }

    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
        return null;
    }

    @Override
    public String getPassword() {
        return null;
    }

    public RBACUser(String userName, Long userId, Long deptId) {
        this.userName = userName;
        this.userId = userId;
        this.deptId = deptId;
    }

    @Override
    public String getUsername() {
        return userName;
    }

    @Override
    public boolean isAccountNonExpired() {
        return true;
    }

    @Override
    public boolean isAccountNonLocked() {
        return true;
    }

    @Override
    public boolean isCredentialsNonExpired() {
        return true;
    }

    @Override
    public boolean isEnabled() {
        return true;
    }
}
